
<h3>Currently inserted Themes Count: </h3>

<div id="themeInsert" dojoType="dijit.TitlePane" title="Insert a new theme" open="false" style="width: 500px;">
   Theme: <input type="text"  maxlength="100" name="newtheme" dojoType="dijit.form.TextBox" trim="true" id="newtheme" propercase="true" style="width: 300px;"><br><br>
   <button dojoType="dijit.form.Button" type="button">
    insert
    <script type="dojo/method" event="onClick" args="evt">
    alert("vollgas");
       dojo.xhrPost(
 {
  url: "action.php",
  load: callBackFunction,
  content:  {
   newtheme: dojo.byId("newtheme").value,
   func: "theme",
   goal: "add"
  }
 } );
       dojo.byId("newtheme").value = "";
    </script>
</button>
</div><br><br>

<div dojoType="dojo.data.ItemFileReadStore" url="action.php?func=theme&goal=load" jsId="themeList" urlPreventCache="true" clearOnClose="true">
</div>

<table id="themeTable" dojoType="dojox.grid.DataGrid" store="themeList" query="{ tag: '*' }" clientSort="true" style="width: 100%; height: 100%;">
    <thead>
        <tr>
            <th width="auto" field="tag">
               Theme
            </th>
            <th width="50px" field="user">
                user
            </th>
	    <th width="50px" field="times">
                Times
            </th>
	    <th width="100px" field="inserted">
                Inserted
            </th>
        </tr>
    </thead>
</table>

   <script type="text/javascript">
        dojo.require("dojox.grid.DataGrid");
        dojo.require("dojo.data.ItemFileReadStore");
	dojo.require("dijit.TitlePane");
        dojo.require("dijit.form.TextBox");
	dojo.require("dijit.form.Button");
	
	function callBackFunction() {
	    themeList.url = "action.php?func=theme&goal=load";
	    themeList.close();

	    dijit.byId("themeTable").render();
	}
  

    </script>